#{extends 'main.html'/}
<script type="text/javascript">
  
    var managerTree = null;
    function displayAllCheckContent(data,flag){
        document.mainform.reset();  
        var id=null;
        if(flag==0){                        //flag 为0 为点击人员树操作，其它为个人考评或人员搜索
            id=data.id.replace("u",'');   
            $("#name").val(data.text); 
            $("#dept").val(data.deptname); 
        } else{
            id=data.id;
            $("#name").val(data.realName); 
            $("#dept").val(data.dept.name);
        }  
        $("#userId").val(id);   
        $("#sex").val(data.sex);                 
        
        /*     改变专业类别的显示方式
        var obj = document.getElementsByName("category")      
        for(var i=0;i<obj.length;i++){
            if(data.category==obj[i].value){
                obj[i].checked=true;   
                break;
            }
        }*/
       
        $("#category").val(data.category); 
        $("#job").val(data.job);
        $("#jobInTime").val(data.jobInTime);
        $("#qcn").val(data.qcn);
        $("#pcn").val(data.pcn);           
        
        //获取医院信息
        $.getJSON("check_hospital/", function(json){                 
            if(json != null)   {
                $("#hospital_name").val(json.name);       
            }                                    
        });          
        
        var year=$("#checkYear").val();    
        $("#year").val(year);      //设置考评年度  
        
        $.getJSON("check_getHaveVoteKill/", {UserId:id,Year:year},function(json){                 
            if(json != null)   {
                $("#haveVoteKill").val("有");       
            }                                    
        });  
        init_check_self(id,year);     //获取自我评价    
        init_check_dept(id,year);     //获取科室评价            
        init_check_peo(id,year);      //获取群众评价         
        init_check_com(id,year);      //获取单位评价   
        init_check_complex(id,year);  //获取综合评价，备注，等级信息             
        init_check_remark(id,year);   //备注
    }

    function init_check_self(id,year){                                
        $.getJSON("check_self/",{UserId:id,Year:year}, function(json){                 
            if(json !=null)   {                
                if(json.score!=null){                   
                    $("#self_score").val(json.score);
                } 
                if(json.remark!=null){                     
                    $("#self_Remark").val(json.remark);
                } 
                if(json.recordTime!=null){
                    var index=json.recordTime.indexOf("-");
                    var monstr=json.recordTime.substring(index+1,index+3);
                    var daystr=json.recordTime.substring(index+4,index+6);
                    $("#selfMonth").val(monstr);
                    $("#selfDay").val(daystr);                      
                } 
            }        
        });                    
    }
    
    function  init_check_dept(id,year){
        $.getJSON("check_dept/",{UserId:id,Year:year}, function(json){                 
            if(json !=null)   {                            
                if(json.score!=null){
                    $("#dept_score").val(json.score);
                } 
                if(json.remark!=null){                  
                    $("#dept_Remark").val(json.remark);
                } 
                if(json.recordTime!=null){
                    var index=json.recordTime.indexOf("-");
                    var monstr=json.recordTime.substring(index+1,index+3);
                    var daystr=json.recordTime.substring(index+4,index+6);
                    $("#deptMonth").val(monstr);
                    $("#deptDay").val(daystr);                     
                }                       
            }      
        });               
    }
    
    function init_check_peo(id,year){            
        $.getJSON("check_peo/",{UserId:id,Year:year}, function(json){                 
            if(json !=null)   {                   
                if(json.agreeNumber!=null){
                    $("#agreeNumber").val(json.agreeNumber);
                } 
                if(json.notAgreeNumber!=null){
                    $("#notAgreeNumber").val(json.notAgreeNumber);
                } 
                if(json.notAgreeCause!=null){
                    $("#notAgreeCause").val(json.notAgreeCause);
                } 
                if(json.recordTime!=null){                      
                    var index=json.recordTime.indexOf("-");
                    var monstr=json.recordTime.substring(index+1,index+3);
                    var daystr=json.recordTime.substring(index+4,index+6);
                    $("#peoMonth").val(monstr);
                    $("#peoDay").val(daystr);       
                } 
            }              
        });                     
    }
    
    function init_check_com(id,year){
        $.getJSON("check_com_grade/",{UserId:id,Year:year}, function(json){
            if(json!=null){
                if(json.gradeName!=null){
                    $("#grade").val(json.gradeName);
                } 
            }               
        });          
        $.getJSON("check_com/",{UserId:id,Year:year}, function(json){   
            if(json!=null){
                if(json.recordTime!=null){
                    if(json.score!=null){
                        $("#com_score").val(json.score);
                    }
                    var index=json.recordTime.indexOf("-");
                    var monstr=json.recordTime.substring(index+1,index+3);
                    var daystr=json.recordTime.substring(index+4,index+6);
                    $("#comMonth").val(monstr);
                    $("#comDay").val(daystr);                           
                }
            } 
        });        
    }
    
    function init_check_complex(id,year){          
        $.getJSON("check_complex/",{UserId:id,Year:year}, function(json){                 
            if(json !=null)   {
                if(json.conclusion!=null){
                    $("#conclusion").val(json.conclusion);
                }
                if(json.conclusionTime!=null){                   
                    var index=json.conclusionTime.indexOf("-");
                    var monstr=json.conclusionTime.substring(index+1,index+3);
                    var daystr=json.conclusionTime.substring(index+4,index+6);
                    $("#conclusionMonth").val(monstr);
                    $("#conclusionDay").val(daystr);                       
                }      
            }                          
        });                                                          
    }
    
    function init_check_remark(id,year){      
        $.getJSON("check_remark/",{UserId:id,Year:year}, function(json){                 
            if(json !=null)   {
                if(json.remark!=null){
                    $("#Remark").val(json.remark);
                }                 
            }                        
        });                                        
    }    
    
    
    
    $(function () { 
        //$('#navtab1').bind("selectstart",function(){return false;}); 
    
        var tag=${tag};       
        if (tag==0) {
            $("#userTreeDiv").hide() ; 
            $("#queryDiv").hide() ;           
        } else{
            $("#userTreeDiv").show();
            $("#queryDiv").show() ;  
        }
        var allgrid;
        var grades=[{"id":1,name:"优秀"},{"id":2,name:"良好"},{"id":3,name:"一般"},{"id":4,name:"较差"}];
        
        var date=new Date();
        var fullyear=date.getFullYear();        
        var options=document.getElementById("checkYear").options;  //下拉框           
        var len=options.length;
        for(var i=0;i<len;i++){                 
            if (options[i].value==fullyear){              
                options[i].selected=true;
                break;
            }
        }
        
        $("#layout1").ligerLayout({leftWidth: 170, height: 1400});
        
        var userTree = $("#userTree").ligerTree({
            nodeWidth: 50,
            parentIcon: "folder",
            childIcon: "leaf",
            checkbox: false,
            url: "/usertree",
            idFieldName :'id', parentIDFieldName :'pid'        
        }); 
        managerTree = $("#userTree").ligerGetTreeManager();
        userTree.bind("click",
        function(node) {        
            document.mainform.reset();    // 清空form ,无需一一赋空值
          //  id= node.data.id;           // 屏蔽
            pid= node.data.pid;         
            pid=pid.replace("d",'');        
            if(pid>0){                    //选中为医生             
                displayAllCheckContent(node.data,0);       
            }
        }            
    );
        
        if(tag==0){
            $("#toptoolbar").ligerToolBar({ items: [
                    { text: '自我评价填写', click: showDetail_Self_submit, icon:'add'},
                    { line:true },
                    { text: '备注', click: showDetail_Remark_submit, icon:'add'},
                    { line:true },
                    { text: '查看全部',  click: re_allgrid_submit, icon:'archives' }
                ] });
            //个人考评，自动获得考评内容         
            $.ajax({
                loading: '正在查询中...',
                type: 'POST',
                url: '/queryuser',                  
                data: {name:'个人考评'},
                success: function (json)
                {
                    if(json!=null){      //展示考评内容，调用displayAllCheckContent方法
                        displayAllCheckContent(json,1);                         
                    } 
                },
                error: function (message)
                {
                    LG.tip(message);                 
                }
            });
            
        } else if(tag==1){
            $("#toptoolbar").ligerToolBar({ items: [       
                    { text: '科室评价填写', click: showDetail_Dept_submit, icon:'add'},
                    { line:true },          
                    { text: '查看全部',  click: re_allgrid_submit, icon:'archives' }
                ] }); 
        } else if(tag==2){
            $("#toptoolbar").ligerToolBar({ items: [
                    { text: '群众评价填写', click: showDetail_Peo_submit, icon:'add' },
                    { line:true },
                    { text: '单位评价填写', click: showDetail_Com_submit, icon:'add' },
                    { line:true },           
                    { text: '查看全部',  click: re_allgrid_submit, icon:'archives' }
                ]});
        } else{
            $("#toptoolbar").ligerToolBar({ items: [              
                    { text: '综合评价填写', click: showDetail_Complex_submit, icon:'add' },
                    { line: true },
                    { text: '查看全部',  click: re_allgrid_submit, icon:'archives' },
                    { line: true },
                    { text: '导出',  click: export_excel, icon:'outbox' }
                ]});           
        }
        
        
        //查看所有项目        
        allgrid = $("#allgrid").ligerGrid({
            columns: [{ display: '填报日期', name: 'noteDate',type:'text',width: 80 },
                { display: '姓名', name: 'realName', type:'text',width: 60 },
                { display: '科室', name: 'deptName', type:'text',width: 80 },
                { display: '事项', name: 'content',  align: 'left',type:'text',width: 150 },
                { display: '分数', name: 'score', type:'text',width: 60 },
                { display: '经办人(证明人)', name: 'certifyMan', type:'text',width: 100 },
                { display: '审核状态', name: 'approveLevelName', width: 100},
                { display: '备注', name: 'approveComment', width: 100}
            ],               
            url: "",  
            method: "GET",                             
            title:"所有项目", 
            width: '98%', height: '78%', pageSize: 20       
        });
        
        function re_allgrid(id,year) {
            var allurl= "notes/checkalljson?tag=1"+'&userid='+id+'&deptid=1&pageSize=10&checkYear='+year;
            $("#allgrid").ligerGrid('option', 'url', allurl);
            allgrid.loadData(true);
            
            detailWin_Allgrid = $.ligerDialog.open({
                width: 820, height: 450, top:20,
                target: $("#allgrid")               
            });
        }
        
        var userid, year;
        function getQueryParam() {
            userid=$("#userId").val();  
            year=$("#checkYear").val();   
            
            if(!userid){
                $.ligerDialog.warn('请选择填报对象！')               
                return false;
            }
        }
        
        function showDetail_Self_submit()  {
            if (getQueryParam()==false) return false;
            
            $.getJSON("check_self/",{UserId:userid,Year:year}, function(json){                 
                showDetail_Self(json,year);              
            });
        }
        
        function showDetail_Dept_submit(){
            if (getQueryParam()==false) return false;
            
            $.getJSON("check_dept/",{UserId:userid,Year:year}, function(json){                 
                showDetail_Dept(json,year);                     
            });                                 
        }
        
        function showDetail_Peo_submit(){
            if (getQueryParam()==false) return false;
            
            $.getJSON("check_peo/",{UserId:userid,Year:year}, function(json){                 
                showDetail_Peo(json,year);                       
            });                     
        }
        
        function  init_com_Evaluation(grade){
            if (getQueryParam()==false) return false;
            
            $.getJSON("check_com/",{UserId:userid,Year:year}, function(json){                 
                showDetail_Com(grade,json,year);                            
            });
        }
        
        function showDetail_Com_submit(){
            if (getQueryParam()==false) return false; 
            
            var  Grade=null;
            $.getJSON("check_com_grade/",{UserId:userid,Year:year}, function(json){                 
                Grade=json; 
                init_com_Evaluation(Grade);                        
            });
        }
        
        function showDetail_Complex_submit(){
            if (getQueryParam()==false) return false;      
            $.getJSON("check_complex/",{UserId:userid,Year:year}, function(json){                 
                showDetail_Complex(json,year);                         
            });            
        }
        function showDetail_Remark_submit(){
            if (getQueryParam()==false) return false;      
            $.getJSON("check_remark/",{UserId:userid,Year:year}, function(json){                 
                showDetail_Remark(json,year);                         
            });            
        }
        
        function re_allgrid_submit() {
            if (getQueryParam()==false) return false;
            
            re_allgrid(userid, year);
        }

        function export_excel() {
            if (getQueryParam()==false) return false;
            location.href = "check_export_excel/?UserId=" + userid + "&Year=" + year;        
        }
        
        var detailWin_Self = null, curentData = null, currentIsAddNew;
        var detailWin_Dept = null, curentData1 = null, currentIsAddNew1;
        var detailWin_Peo = null, curentData2= null, currentIsAddNew2;
        var detailWin_Com = null, curentData3 = null, currentIsAddNew3;
        var detailWin_Complex = null, curentData4 = null, currentIsAddNew4;
        var detailWin_Remark = null, curentData5 = null, currentIsAddNew5;
        
        
        function showDetail_Self(data,year)
        {                     
            var userid=$("#userId").val();   
            var name=$("#name").val();
            var selfform=$("#selfform");
            
            if(detailWin_Self!=null){
                detailWin_Self=null;
            }
            if (detailWin_Self)
            {
                detailWin_Self.show(); 
            }
            else
            {   
                //创建表单结构
                selfform.ligerForm({                    
                    fields: [
                        { name: "userID", type: "hidden" },                   
                        { name: "record.year", type: "hidden" }, 
                        {display: "当前对象", name: "currentObject", type: "text",
                            labelWidth: 100, width: 220, space: 30,newline: true },
                        { display: "自我评分", name: "recorddetail.score", newline: true, 
                            labelWidth: 100, width: 220, space: 30,type: "text" } ,   
                        { display: "自我评价", name: "recorddetail.remark", newline: true, 
                            labelWidth: 100, width: 220, space: 30,type: "textarea" } ,                    
                        { display: "填报日期", name: "recorddetail.recordTime", newline: true,
                            labelWidth: 100, width: 220, space: 30,type: "date", 
                            validate: { required: true, maxlength: 50} }                                         
                    ],
                    toJSON: JSON2.stringify
                });
                $("[name$=year]").val(year);           
                $("[name$=userID]").val(userid);
                $("[name$=currentObject]").val(name);  
                $("#currentObject").ligerGetTextBoxManager().setDisabled();
                if(data){                
                    $("[name$=remark]").val(data.remark);  
                    $("[name$=recordTime]").val(data.recordTime);              
                }else{                                       
                    $("[name$=remark]").val('');  
                    $("[name$=recordTime]").val('');
                }
                
                $.getJSON("checkautoscore/",{UserId:userid,Year:year,level:0}, function(json){                 
                    if(json!=null){                 
                        $("[name$='recorddetail.score']").val(json);   
                        //设定分数不可改
                        $("[name$='recorddetail.score']").attr('readonly', 'readonly');   
                    }
                });
                
                detailWin_Self = $.ligerDialog.open({
                    target: $("#self_Evaluation"),
                    width: 300, height: 400, top:80,
                    buttons: [
                        { text: '确定', onclick: function () { save_Self(); } },
                        { text: '取消', onclick: function () { detailWin_Self.hide(); } }
                    ]
                });         
            }
            
            function save_Self()
            {
                $("#selfform").validate();      
                $.ajax({
                    loading: '正在保存数据中...',
                    type: 'POST',
                    url: 'check_self',                  
                    data: $("#selfform").serialize(),
                    success: function ()
                    {
                        detailWin_Self.hide();                     
                        LG.tip('保存成功!');             
                        init_check_self(userid,year);
                    },
                    error: function (message)
                    {
                        LG.tip(message);
                    }
                });
            }         
        }
        
        function showDetail_Dept(data,year)
        {     
            var userid=$("#userId").val();  
            var name=$("#name").val();
            var deptform=$("#deptform");
            
            if(detailWin_Dept!=null){
                detailWin_Dept=null;
            }
            if (detailWin_Dept)
            {
                detailWin_Dept.show(); 
            }
            else
            {  
                //创建表单结构
                deptform.ligerForm({
                    // inputWidth: 280,
                    fields: [
                        { name: "userID1", type: "hidden" },
                        { name: "record1.year", type: "hidden" },
                        {display: "当前对象", name: "currentObject1", type: "text",
                            labelWidth: 100, width: 220, space: 30,newline: true },
                        { display: "科室评分", name: "recorddetail1.score", newline: true, 
                            labelWidth: 100, width: 220, space: 30, type: "text" } ,
                        { display: "科室评价", name: "recorddetail1.remark", newline: true, 
                            labelWidth: 100, width: 220, space: 30, type: "textarea" } ,
                        { display: "填报日期", name: "recorddetail1.recordTime", newline: true,
                            labelWidth: 100, width: 220, space: 30, type: "date", 
                            validate: { required: true, maxlength: 50} }],
                    
                    toJSON: JSON2.stringify
                });
                $("[name$=year]").val(year);           
                $("[name$=userID1]").val(userid);    
                $("[name$=currentObject1]").val(name);  
                $("#currentObject1").ligerGetTextBoxManager().setDisabled();
                if(data){              
                    $("[name$=remark]").val(data.remark);  
                    $("[name$=recordTime]").val(data.recordTime);              
                }else{              
                    $("[name$=remark]").val('');  
                    $("[name$=recordTime]").val('');
                }
                $.getJSON("checkautoscore/",{UserId:userid,Year:year,level:1}, function(json){                 
                    if(json!=null){                 
                        $("[name$='recorddetail1.score']").val(json);   
                        $("[name$='recorddetail1.score']").attr('readonly', 'readonly');   
                    }
                });           
                detailWin_Dept = $.ligerDialog.open({
                    target: $("#dept_Evaluation"),
                    //width: 300, height: 400, top:80,
                    buttons: [
                        { text: '确定', onclick: function () { save_Dept(); } },
                        { text: '取消', onclick: function () { detailWin_Dept.hide(); } }
                    ]
                });         
            }
            
            function save_Dept()
            {
                $("#deptform").validate();      
                $.ajax({
                    loading: '正在保存数据中...',
                    type: 'POST',
                    url: 'check_dept',                  
                    data: $("#deptform").serialize(),
                    success: function ()
                    {
                        detailWin_Dept.hide();                     
                        LG.tip('保存成功!');
                        init_check_dept(userid,year);
                    },
                    error: function (message)
                    {
                        LG.tip(message);
                    }
                });
            }         
        }
        
        function showDetail_Peo(data,year)
        {    
            var userid=$("#userId").val(); 
            var name=$("#name").val();
            var peoform=$("#peoform");
            
            if(detailWin_Peo!=null){
                detailWin_Peo=null;
            }
            if (detailWin_Peo)
            {
                detailWin_Peo.show(); 
            }
            else
            {    
                //创建表单结构
                peoform.ligerForm({
                    // inputWidth: 280,
                    fields: [
                        { name: "userID2", type: "hidden" },
                        { name: "record2.year", type: "hidden" }, 
                        {display: "当前对象", name: "currentObject2", type: "text",
                            labelWidth: 100, width: 220, space: 30,newline: true },
                        { display: "同意人数", name: "recorddetail2.agreeNumber", newline: true, 
                            labelWidth: 100, width: 220, space: 30, type: "text"},   
                        { display: "不同意人数", name: "recorddetail2.notAgreeNumber", newline: true,
                            labelWidth: 100, width: 220, space: 30, type: "text"},
                        { display: "不同意原因", name: "recorddetail2.notAgreeCause", newline: true, 
                            labelWidth: 100, width: 220, space: 30, type: "textarea" } ,                
                        { display: "填报日期", name: "recorddetail2.recordTime", newline: true,
                            labelWidth: 100, width: 220, space: 30, type: "date", 
                            validate: { required: true, maxlength: 50} }],
                    
                    toJSON: JSON2.stringify
                });
                
                $("[name$=year]").val(year);           
                $("[name$=userID2]").val(userid);
                $("[name$=currentObject2]").val(name);  
                $("#currentObject2").ligerGetTextBoxManager().setDisabled();
                
                if(data){                
                    $("[name$=agreeNumber]").val(data.agreeNumber);  
                    $("[name$=notAgreeNumber]").val(data.notAgreeNumber);  
                    $("[name$=notAgreeCause]").val(data.notAgreeCause); 
                    $("[name$=recordTime]").val(data.recordTime);
                }else{                                       
                    $("[name$=agreeNumber]").val('');  
                    $("[name$=notAgreeNumber]").val('');  
                    $("[name$=notAgreeCause]").val('');
                    $("[name$=recordTime]").val('');
                }
                detailWin_Peo = $.ligerDialog.open({
                    target: $("#peo_Evaluation"),
                    // width: 300, height: 400, top:80,
                    buttons: [
                        { text: '确定', onclick: function () { save_Peo(); } },
                        { text: '取消', onclick: function () { detailWin_Peo.hide(); } }
                    ]
                });         
            }
            
            function save_Peo()
            {
                $("#peoform").validate();      
                $.ajax({
                    loading: '正在保存数据中...',
                    type: 'POST',
                    url: 'check_peo',                  
                    data: $("#peoform").serialize(),
                    success: function ()
                    {
                        detailWin_Peo.hide();                     
                        LG.tip('保存成功!');
                        init_check_peo(userid,year);
                    },
                    error: function (message)
                    {
                        LG.tip(message);
                    }
                });
            }         
        }
        
        function showDetail_Com(Grade,data,year)
        {    
            var userid=$("#userId").val(); 
            var name=$("#name").val();
            var comform=$("#comform");
            
            if(detailWin_Com!=null){
                detailWin_Com=null;
            }
            if (detailWin_Com)
            {
                detailWin_Com.show(); 
            }
            else
            {    
                //创建表单结构
                comform.ligerForm({
                    //   inputWidth: 280,
                    fields: [
                        { name: "userID3", type: "hidden" },
                        { name: "record3.year", type: "hidden" },   
                        {display: "当前对象", name: "currentObject3", type: "text",
                            labelWidth: 100, width: 220, space: 30,newline: true },
                        {display: "单位评分", name: "recorddetail3.score", type: "text",
                            labelWidth: 100, width: 220, space: 30,newline: true },
                        { display: "单位评价等次", name: "gradeHide", comboboxName:"gradeCombox", newline: true, 
                            labelWidth: 100, width: 220, space: 30, type: "select",
                            options: {data: grades, valueField: 'id', textField: 'name'} },         
                        { display: "填报日期", name: "recorddetail3.recordTime", newline: true,
                            labelWidth: 100, width: 220, space: 30, type: "date", 
                            validate: { required: true, maxlength: 50} }],                
                    toJSON: JSON2.stringify
                });
                
                $("[name$=year]").val(year);           
                $("[name$=userID3]").val(userid); 
                $("[name$=currentObject3]").val(name);  
                $("#currentObject3").ligerGetTextBoxManager().setDisabled();   
                if(Grade!=null){
                    if(Grade.gradeId){             
                        $("#gradeCombox").ligerGetComboBoxManager().setValue(Grade.gradeId);  
                    } else{
                        $("#gradeCombox").ligerGetComboBoxManager().setValue('');  
                    }
                }
                else{
                    $("#gradeCombox").ligerGetComboBoxManager().setValue('');                 
                }
                if(data){                                                
                    $("[name$=recordTime]").val(data.recordTime);
                }else{                                                        
                    $("[name$=recordTime]").val('');
                }         
                $.getJSON("checkautoscore/",{UserId:userid,Year:year,level:2}, function(json){                 
                    if(json!=null){                 
                        $("[name$='recorddetail3.score']").val(json);   
                        $("[name$='recorddetail3.score']").attr('readonly', 'readonly');   
                    }
                });          
                detailWin_Com = $.ligerDialog.open({
                    target: $("#com_Evaluation"),
                    //   width: 300, height: 400, top:80,
                    buttons: [
                        { text: '确定', onclick: function () { save_Com(); } },
                        { text: '取消', onclick: function () { detailWin_Com.hide(); } }
                    ]
                });         
            }
            
            function save_Com()
            {
                $("#comform").validate();      
                $.ajax({
                    loading: '正在保存数据中...',
                    type: 'POST',
                    url: 'check_com',                  
                    data: $("#comform").serialize(),
                    success: function ()
                    {
                        detailWin_Com.hide();                     
                        LG.tip('保存成功!');
                        init_check_com(userid,year);
                    },
                    error: function (message)
                    {
                        LG.tip(message);
                    }
                });
            }         
        }
        
        function showDetail_Complex(data,year)
        {    
            var userid=$("#userId").val();  
            var name=$("#name").val();                        
            var complexform=$("#complexform");
            
            if(detailWin_Complex!=null){
                detailWin_Complex=null;
            }
            if (detailWin_Complex)
            {
                detailWin_Complex.show(); 
            }
            else
            {    
                //创建表单结构
                complexform.ligerForm({
                    //    inputWidth: 280,
                    fields: [
                        { name: "userID4", type: "hidden" },
                        { name: "record4.year", type: "hidden" },  
                        {display: "当前对象", name: "currentObject4", type: "text",
                            labelWidth: 100, width: 220, space: 30,newline: false },
                        { display: "综合考评结论", name: "record4.conclusion", newline: true, 
                            labelWidth: 100, width: 220, space: 30, type: "text"},                          
                        { display: "填报日期", name: "record4.conclusionTime", newline: true,
                            labelWidth: 100, width: 220, space: 30, type: "date", 
                            validate: { required: true, maxlength: 50} }],                 
                    toJSON: JSON2.stringify
                });
                
                $("[name$=year]").val(year);           
                $("[name$=userID4]").val(userid);     
                $("[name$=currentObject4]").val(name);  
                $("#currentObject4").ligerGetTextBoxManager().setDisabled();
                if(data){                
                    $("[name$=conclusion]").val(data.conclusion);                
                    $("[name$=conclusionTime]").val(data.conclusionTime);
                }else{                                       
                    $("[name$=conclusion]").val('');                
                    $("[name$=conclusionTime]").val('');
                }
                detailWin_Complex = $.ligerDialog.open({
                    target: $("#complex_Evaluation"),
                    //   width: 300, height: 400, top:80,
                    buttons: [
                        { text: '确定', onclick: function () { save_Complex(); } },
                        { text: '取消', onclick: function () { detailWin_Complex.hide(); } }
                    ]
                });         
            }
            
            function save_Complex()
            {
                $("#complexform").validate();      
                $.ajax({
                    loading: '正在保存数据中...',
                    type: 'POST',
                    url: 'check_complex',                  
                    data: $("#complexform").serialize(),
                    success: function ()
                    {
                        detailWin_Complex.hide();                     
                        LG.tip('保存成功!');
                        init_check_complex(userid,year);
                    },
                    error: function (message)
                    {
                        LG.tip(message);
                    }
                });
            }         
        }
        
        function showDetail_Remark(data,year)
        {    
            var userid=$("#userId").val();   
            var name=$("#name").val();
            var remarkform=$("#remarkform");
            
            if(detailWin_Remark!=null){
                detailWin_Remark=null;
            }
            if (detailWin_Remark)
            {
                detailWin_Remark.show(); 
            }
            else
            {    
                //创建表单结构
                remarkform.ligerForm({
                    // inputWidth: 280,
                    fields: [
                        
                        { name: "userID5", type: "hidden" },
                        { name: "record5.year", type: "hidden" },  
                        {display: "当前对象", name: "currentObject5", type: "text",
                            labelWidth: 100, width: 220, space: 30,newline: true },
                        {display: "备注", name: "record5.remark", newline: true, 
                            labelWidth: 100, width: 220, space: 30, type: "textarea"}                        
                    ],                 
                    toJSON: JSON2.stringify
                });
                
                $("[name$=year]").val(year);           
                $("[name$=userID5]").val(userid);   
                $("[name$=currentObject5]").val(name);  
                $("#currentObject5").ligerGetTextBoxManager().setDisabled();
                if(data){                
                    $("[name$=remark]").val(data.remark);                              
                }else{                                       
                    $("[name$=remark]").val('');                              
                }
                
                detailWin_Remark = $.ligerDialog.open({
                    target: $("#remark_Evaluation"),
                    //    width: 300, height: 400, top:80,
                    buttons: [
                        { text: '确定', onclick: function () { save_Remark(); } },
                        { text: '取消', onclick: function () { detailWin_Remark.hide(); } }
                    ]
                });         
            }
            
            function save_Remark()
            {
                $("#remarkform").validate();      
                $.ajax({
                    loading: '正在保存数据中...',
                    type: 'POST',
                    url: 'check_remark',                  
                    data: $("#remarkform").serialize(),
                    success: function ()
                    {
                        detailWin_Remark.hide();                     
                        LG.tip('保存成功!');
                        init_check_remark(userid,year);
                    },
                    error: function (message)
                    {
                        LG.tip(message);
                    }
                });
            }         
        }
        
    });    
    function EnterPress(event){             //IE8支持此方法
        if(event.keyCode==13){              //回车键作为执行查询操作
            var name=$("#queryByName").val();  
            document.mainform.reset();   
            $.ajax({
                loading: '正在查询中...',
                type: 'POST',
                url: '/queryuser',                  
                data: {name:name},
                success: function (json)
                {
                    if(json!=null){
                        managerTree.selectNode ("u"+json.id) ;    //让人员处于选中状态 
                        displayAllCheckContent(json,1);           //显示                                               
                    } else{
                        LG.tip("查询无结果!");
                    }                  
                    // LG.tip('保存成功!');
                },
                error: function (message)
                {
                    LG.tip(message);                 
                }
            });
        }
    }  
    
    document.onselectstart=function(){return false;}
    
</script>




<div id="navtab1" style="width: 880px; overflow:hidden; border:1px solid #A3C0E8; " >
    <div id="layout1" class="layout1">
        <div position="left" title="条件选择"  >
            #{include '/components/choose.html'/}
        </div>         
        <div id="layout_commands" position="center" title="医务人员医德考评表">
            <div id="toptoolbar"></div>
            <div id="self_Evaluation" style="display:none">
                <form id="selfform"  method="post"></form>
            </div>
            <div id="dept_Evaluation" style="display:none">
                <form id="deptform"  method="post"></form>
            </div>
            <div id="peo_Evaluation" style="display:none">
                <form id="peoform"  method="post"></form>
            </div>
            <div id="com_Evaluation" style="display:none">
                <form id="comform"  method="post"></form>
            </div>
            <div id="complex_Evaluation" style="display:none">
                <form id="complexform"  method="post"></form>
            </div>
            <div id="remark_Evaluation" style="display:none">
                <form id="remarkform"  method="post"></form>
            </div>
            <div id="allgrid" style="display:none"></div>

            <p align="center" style="display:none"><strong>山东省医务人员医德考评表</strong><strong> </strong></p>                                         
            <form id="mainform" name="mainform">
                <input  id="userId" name="userId"  value=""  type="hidden" />                  
                <table border="1" cellspacing="1" cellpadding="1" width="600px">
                    <tr>
                        <td width="9%" rowspan="6"><br />
                            &nbsp;&nbsp;医 <br />
                            &nbsp;&nbsp;师 <br />
                            &nbsp;&nbsp;基 <br />
                            &nbsp;&nbsp;本 <br />
                            &nbsp;&nbsp;信 <br />
                            &nbsp;&nbsp;息 </td>
                        <td width="18%"  align="center"><p>&nbsp;姓名：</p></td>
                        <td width="18%"  align="center"><input  id="name" name="name" class="Base_input" value=""  type="text" size="10" readonly="readonly"/></td>
                        <td width="18%" align="center"><p> &nbsp;性别：</p></td>
                        <td width="18%" align="center">
                            <!--  不采用下拉框的方式显示
                            <select id="sex" name="sex"  >
                                <option value=""></option>
                                <option value="男">男</option>
                                <option value="女">女</option>
                            </select>-->
                            <input  id="sex" name="sex" class="Base_input" value=""  type="text" size="10" readonly="readonly"/>
                        </td>
                        <td width="19%" rowspan="6"><br />
                            &nbsp;&nbsp;照 <br />
                            &nbsp;&nbsp; <br />
                            &nbsp;&nbsp; <br />
                            &nbsp;&nbsp; <br />
                            &nbsp;&nbsp; <br />
                            &nbsp;&nbsp;片</td>
                    </tr>
                    <tr>   
                    <tr>
                         <td  ><p>&nbsp;科室：</p></td>
                         <td align="center">
                              <input  id="dept" name="dept" class="Base_input" value=""  type="text" size="10" readonly="readonly"/>
                         </td>
                          <td  ><p>&nbsp;专业类别：</p></td>
                          <td align="center">
                               <input  id="category" name="category" class="Base_input" value=""  type="text" size="10" readonly="readonly"/>
                          </td>
                       <!-- <td width="72%" colspan="4" valign="top">  <p>&nbsp;专业类别：
                                <input type="radio" name="category" value="医师"  /> 医师
                                <input type="radio" name="category" value="护士" /> 护士    
                                <input type="radio" name="category" value="医技人员" /> 医技人员        
                                <input type="radio" name="category" value="其他" /> 其他  </p>  
                        </td>-->
                    </tr>   
                    <td  ><p>&nbsp;技术职务：</p></td>
                    <td align="center">
                        <input  id="job" name="job" class="Base_input" value=""  type="text" size="10" readonly="readonly"/>
                    </td>
                    <td  valign="top"><p> &nbsp;任职时间：</p> </td>
                    <td align="center">
                        <input   id="jobInTime" name="jobInTime" class="Base_input" value=""  type="text" size="10" readonly="readonly"/>
                        </tr>
                    <tr>
                        <td width="72%" colspan="4" valign="top"><p> &nbsp;资格证书号码（医师）：
                                <input  id="qcn" name="qcn" value="" class="Base_input"  type="text" size="18" readonly="readonly"/>
                            </p>
                        </td>
                    </tr>
                    <tr>
                        <td width="72%" colspan="4" valign="top"><p> &nbsp;执业证书号码(医师或护士)： 
                                <input    id="pcn" name="pcn" value=""  class="Base_input" type="text" size="18" readonly="readonly"/>
                            </p></td>
                    </tr>

                    <tr>
                        <td width="100%" colspan="6" valign="top"><p> &nbsp;考评年度：  <input   name="year" id="year" class="Base_input" readonly="readonly" />
                            </p></td>      
                    </tr>
                    <tr>
                        <td width="100%" colspan="6" valign="top"><p>&nbsp;执业医疗机构名称： 
                                <input    id="hospital_name" name="hospital_name" value=""  type="text" size="30" class="Base_input" readonly="readonly"/>
                            </p></td>
                    </tr>
                    <tr>
                        <td width="9%" rowspan="5"><p align="center">&nbsp;&nbsp;考 <br />
                                &nbsp;&nbsp;评 <br />
                                &nbsp;&nbsp;意 <br />
                                &nbsp;&nbsp;见 </p></td>
                        <td width="12%"><p align="center">&nbsp;&nbsp;自我 <br />
                                &nbsp;&nbsp;评价 </p></td> 
                        <td width="77%" colspan="4" ><br>&nbsp;自我评价得分： <input class= "input_bottom"  id="self_score" name="self_score" value=""  type="text" size="8"  readonly="readonly"/><br><br>
                            &nbsp;自我评价：<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<textarea id="self_Remark" name="self_Remark"  cols ="58" rows = "5"  class="TextArea" readonly="readonly"></textarea>                
                            <p>&nbsp;</p><br>
                            <p align="center">                         医务人员签字：<input class= "input_bottom"  id="self_user" name="self_user" value=""  type="text"  readonly="readonly"/> <br />
                                &nbsp;年 <input class= "input_bottom"  id="selfMonth" name="selfMonth" value=""  type="text" size="3" readonly="readonly"/>月 <input class= "input_bottom"  id="selfDay" name="selfDay" value=""  type="text" size="3" readonly="readonly"/>日</p></td>
                    </tr>
                    <tr>
                        <td width="12%"><p align="center">&nbsp;&nbsp;科室 <br />
                                &nbsp;&nbsp;评价 </p></td>
                        <td width="77%" colspan="4" ><br>&nbsp;科室评价得分：<input class= "input_bottom" id="dept_score" name="dept_score" value=""  type="text" size="8" readonly="readonly"/>  <br /><br>
                            &nbsp;科室评价：<br><br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<textarea id="dept_Remark" name="dept_Remark"  cols ="58" rows = "5" class="TextArea" readonly="readonly"></textarea>   
                            <p>&nbsp;</p><br>
                            <p align="center">                     科室主任签字：<input class= "input_bottom"  id="dept_user" name="dept_user" value=""  type="text" readonly="readonly"/> <br />
                                &nbsp; 年 <input class= "input_bottom"  id="deptMonth" name="deptMonth" value=""  type="text" size="3" readonly="readonly"/>月 <input class= "input_bottom"  id="deptDay" name="deptDay" value=""  type="text" size="3" readonly="readonly"/>日 </p></td>
                    </tr>
                    <tr>
                        <td width="12%"><p align="center">&nbsp;&nbsp;群众 <br />
                                &nbsp;&nbsp;评价 </p></td>
                        <td width="77%" colspan="4" ><br>&nbsp;群众对个人评价和科室评价意见：<br><br>
                            &nbsp;同意人数：  <input class= "input_bottom" id="agreeNumber" name="agreeNumber" value=""  type="text" size="8" readonly="readonly"/>    <br /><br>
                            &nbsp;不同意人数：  <input class= "input_bottom" id="notAgreeNumber" name="notAgreeNumber" value=""  type="text" size="8" readonly="readonly"/>  <br><br>
                            &nbsp;不同意原因：  <input class= "input_bottom" id="notAgreeCause" name="notAgreeCause" value=""  type="text" size="30" readonly="readonly"/>  
                            <p>     <br />
                                <!-- &nbsp;考评机构（公章） -->
                                <br />
                                &nbsp;年 <input class= "input_bottom"  id="peoMonth" name="peoMonth" value=""  type="text" size="3" readonly="readonly"/>月 <input class= "input_bottom"  id="peoDay" name="peoDay" value=""  type="text" size="3" readonly="readonly"/>日 </p></td>
                    </tr>
                    <tr>
                        <td width="12%"><p align="center">&nbsp;&nbsp;单位 <br />
                                &nbsp;&nbsp;评价 </p></td> 
                        <td width="77%" colspan="4" valign="top"><br><p>&nbsp;单位评价得分：<input class= "input_bottom" id="com_score" name="com_score" value=""  type="text" size="8" readonly="readonly"/>    <br />
                                &nbsp;单位评价等次：
                                <input type="text" class= "input_bottom" id="grade" name="grade" value="" size="8" readonly="readonly"/> 
                                <br >
                                <br>

                                <!-- &nbsp;考评机构（公章） <br />-->
                                &nbsp;年  <input class= "input_bottom"  id="comMonth" name="comMonth" value=""  type="text" size="3" readonly="readonly"/>月 <input class= "input_bottom"  id="comDay" name="comDay" value=""  type="text" size="3" readonly="readonly"/>日 </p></td>
                    </tr>
                    <tr>
                        <td width="12%"><p align="center"> &nbsp;有无一票否决<br></p><br></td> 
                        <td width="77%" colspan="4" valign="center">&nbsp;&nbsp
                            <input type="text" class= "Base_input" id="haveVoteKill" name="haveVoteKill" value="无" size="10" readonly="readonly"/> </td>
                    </tr>
                    <tr>
                        <td width="9%"><p align="center">&nbsp;&nbsp;考 <br />
                                &nbsp;&nbsp;核 <br />
                                &nbsp;&nbsp;结 <br />
                                &nbsp;&nbsp;果 </p></td>
                        <td width="90%" colspan="5" valign="top"><p>&nbsp;综合考评结论 ： 
                                <input class="input_bottom" id="conclusion" name="conclusion" value="" type="text" size="40" readonly="readonly"/>      
                                       </p>
                            <p align="center">     <!--                            考评机构（公章） --><br><br>
                                &nbsp;年 <input class= "input_bottom"  id="conclusionMonth" name="conclusionMonth" value=""  type="text" size="3" readonly="readonly"/>月 <input class= "input_bottom"  id="conclusionDay" name="conclusionDay" value=""  type="text" size="3" readonly="readonly"/>日 </p></td>
                    </tr>
                    <tr>
                        <td width="9%"><p align="center">&nbsp;&nbsp;备 <br />
                                <br>
                                &nbsp;&nbsp;注 
                            </p>    
                        </td>
                        <td width="90%" colspan="5" align="left">
                            &nbsp;&nbsp;&nbsp;&nbsp;<textarea id="Remark" name="Remark"  rows = "3" cols ="78" class="TextArea" readonly="readonly"></textarea>
                        </td>
                    </tr>
                    <!-- <tr>
                         <td  width="100%" colspan="7" align="center">
                             <input type="Button" value="保 存" id="Button1" style="width:100px" onclick="save()" />
                         </td>     
                     </tr>-->
                </table>
                              
                <!--<p>注：1.考评不合格原因填入备注栏；2.对考评结果不服并提出复核申请的处理情况填入备注栏；3.其它需说明的问题记入备注栏。 </p>-->
                <p>注：1.对考评结果不服并提出复核申请的处理情况填入备注栏；2.其它需说明的问题记入备注栏。 </p>

            </form>
        </div>
    </div>    
</div>

